package com.accedo.achievements.dataaccess.dao;

import java.util.List;
import java.util.Set;

import com.accedo.achievements.dataaccess.model.Achievement;

/**
 * A DAO interface with achievement model database operations.
 * @author Bo Liang
 */
public interface AchievementDao {
	
	/**
	 * Get achievement object by achievement sn.
	 * <p>obtain the achievement object instance by using this achievement serial number<br>
	 * @param	achi_sn	achievement serial number
	 * @return 			achievement object
	 */
	public Achievement getAchiByAchisn(String achi_sn);
	
	/**
	 * Get all achievements which belong to the specific application
	 * <p>By using application's serial number, fetch all this application's achievements into List<br>
	 * @param	app_sn	application serial number
	 * @return			achievements List
	 */
	public List<Achievement> getAchiListByAppsn(String app_sn);
	
	/**
	 * Get one specific badge's all achievements by using this badge's serial number.
	 * @param badge_sn	badge serial number
	 * @return			Set of achievement object
	 */
	public Set<Achievement> getAchiListByBadgesn(String badge_sn);
	
	/**
	 * Get all achievements which refer to the specific campaign.
	 * @param camp_sn	campaign serial number
	 * @return			Set of achievement object
	 */
	public Set<Achievement> getAchiListByCampsn(String camp_sn);
	
	/**
	 * Get the application's achievements quantity by using application sn.
	 * <p>this function will go to search and count the achievements quantity from achievement table.
	 * @param app_sn	application serial number
	 * @return			application's achievements quantity
	 */
	public int getAchiQuantityByAppsn(String app_sn);
	
	/**
	 * Get the application's achievements quantity by using user id and applicaiton sn.
	 * <p>this function will go to search and count the achievements quantity from one user's one application.
	 * @param user_id	user id
	 * @param app_sn	application serial number
	 * @return			achievement quantity
	 */
	public int getAchiQuantityByUserIdAndAppsn(int user_id, String app_sn);
}
